<template>
  <!-- 机构作业范围 -->
  <div class="AppliedActivities-container">
    <div class="AppliedActivities-row">
      <el-row :gutter="20">
        <el-col :span="4">
          <div class="grid-content bg-purple">
            <el-tree
              :expand-on-click-node="false"
              :data="depts"
              :props="defaultProps"
              @node-click="handleNodeClick"
            >
              <template slot-scope="{ data }">
                <el-row>
                  <el-col> {{ data.name }} </el-col>
                </el-row>
              </template>
            </el-tree>
          </div>
        </el-col>
        <Map />
      </el-row>
    </div>
    <!-- <Footer /> -->
  </div>
</template>

<script>
// import Footer from '@/components/Footer/FooterName.vue'
import { getTree } from '@/api/essential'
import Map from './map.vue'
export default {
  components: { Map },
  // components: {
  // Footer }
  data() {
    return {
      depts: [

      ],
      defaultProps: {

      },

    }
  },
  created() {
    this.getTrees()
    // this.hClocs()
    // console.log(this.depts.id)
  },
  methods: {
    async getTrees() {
      const res = await getTree()
      // console.log(res)
      // console.log(JSON.parse(res.data.data))
      // 获取树状机构信息
      this.depts = JSON.parse(res.data.data)
    },
    handleNodeClick() {

    },
    searchMap() {

    }
  }
}
</script>

<style lang="scss" scoped>
.AppliedActivities-container{
  padding: 20px;

  .AppliedActivities-row{
    margin-bottom: 40px;
    .el-row {
    margin-bottom: 20px;
      &:last-child {
        margin-bottom: 0;
      }
    }
    .el-col {
      border-radius: 4px;
    }
    .bg-purple-dark {
      background: #fff;
      height: 800px;
    }
    .bg-purple {
      background: #fff;
      height: 800px;
    }
    .bg-purple-light {
      background: #fff;
    }
    .grid-content {
      border-radius: 4px;
      min-height: 36px;
    }
    .bg-purple-bottom {
      margin-top: 20px

    }
   

  }
}
</style>

